<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title></title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="gadget.css" rel="stylesheet" type="text/css" />
	</head>
	
	<script type="text/javascript" language="javascript">
		function settingsClosed() {
		  //code to update your gadget
		}

		function initGadget()
		{
			checkState();
			System.Gadget.onDock = checkState;
			System.Gadget.onUndock = checkState;
			
			calcTime();
		}
		
		function calcTime()
		{
			var wdName_long = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
			var wdName_short = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
			var mName_long = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
			var mName_short = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
			
			var dteCurrent = new Date();
			var utcTime = dteCurrent.getTime() + (dteCurrent.getTimezoneOffset() * 60000);
			var utcDate = new Date(utcTime);
			var ap = 'AM';
			if (dteCurrent.getHours() > 11) { ap = 'PM'; }
			
			var hour1 = PadDigits(dteCurrent.getHours(), 2).substring(0, 1);
			var hour2 = PadDigits(dteCurrent.getHours(), 2).substring(1, 2);
			var minute1 = PadDigits(dteCurrent.getMinutes(), 2).substring(0, 1);
			var minute2 = PadDigits(dteCurrent.getMinutes(), 2).substring(1, 2);
			var second1 = PadDigits(dteCurrent.getSeconds(), 2).substring(0, 1);
			var second2 = PadDigits(dteCurrent.getSeconds(), 2).substring(1, 2);
			
			document.getElementById("imgHour1").src = document.getElementById("num" + hour1).src;
			document.getElementById("imgHour2").src = document.getElementById("num" + hour2).src;
			document.getElementById("imgMinute1").src = document.getElementById("num" + minute1).src;
			document.getElementById("imgMinute2").src = document.getElementById("num" + minute2).src;
			document.getElementById("imgSecond1").src = document.getElementById("num" + second1).src;
			document.getElementById("imgSecond2").src = document.getElementById("num" + second2).src;
			
			document.getElementById("noonText").innerHTML = ap;
			
			document.getElementById("dayText").innerHTML = wdName_long[dteCurrent.getDay()];//.toUpperCase();
			
			document.getElementById("dateText").innerHTML = mName_long[dteCurrent.getMonth()]//.toUpperCase()
				+ ', ' + dteCurrent.getDate();
			
			setTimeout("calcTime()", 333);
		}
		
		function PadDigits(n, totalDigits) 
		{ 
			n = n.toString(); 
			var pd = ''; 
			if (totalDigits > n.length) 
			{ 
				for (i=0; i < (totalDigits-n.length); i++) 
				{ 
					pd += '0'; 
				} 
			} 
			return pd + n.toString(); 
		}

		function checkState()
		{
			if(!System.Gadget.docked)
			{
				undockedState();
			}
			else if (System.Gadget.docked)
			{
				dockedState();
			}
		}

		function undockedState()
		{

		}

		function dockedState()
		{

		}
	</script>

	<body onload="initGadget()">
		<div
			id="timeText">&nbsp;<img 
			id="imgHour1" src="_gfx/digital_7.png"><img 
			id="imgHour2" src="_gfx/digital_7.png"><img 
			src="_gfx/digital_-.png"><img 
			id="imgMinute1" src="_gfx/digital_0.png"><img 
			id="imgMinute2" src="_gfx/digital_5.png"><img 
			src="_gfx/digital_-.png"><img 
			id="imgSecond1" src="_gfx/digital_0.png"><img 
			id="imgSecond2" src="_gfx/digital_5.png"></div>
		<div id="noonText">PM</div>
		<div id="dayText">SATURDAY</div>
		<div id="dateText">MAY, 05</div>
		
		<div id="numbersHidden" style="visibility:hidden;">
			<img id="num0" src="_gfx/digital_0.png">
			<img id="num1" src="_gfx/digital_1.png">
			<img id="num2" src="_gfx/digital_2.png">
			<img id="num3" src="_gfx/digital_3.png">
			<img id="num4" src="_gfx/digital_4.png">
			<img id="num5" src="_gfx/digital_5.png">
			<img id="num6" src="_gfx/digital_6.png">
			<img id="num7" src="_gfx/digital_7.png">
			<img id="num8" src="_gfx/digital_8.png">
			<img id="num9" src="_gfx/digital_9.png">
			<img id="num-" src="_gfx/digital_-.png">
		</div>
	</body>
</html>